package scau.gsmg.misp.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * SaleReturnItems entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sale_return_items", catalog = "misp")
public class SaleReturnItems implements java.io.Serializable {

	// Fields

	private Integer id;
	private SaleReturn saleReturn;
	private SaleOrderItems saleOrderItems;
	private Integer quantity;
	private Double price;
	private String reason;

	// Constructors

	/** default constructor */
	public SaleReturnItems() {
	}

	/** minimal constructor */
	public SaleReturnItems(SaleReturn saleReturn,
			SaleOrderItems saleOrderItems, Integer quantity, Double price) {
		this.saleReturn = saleReturn;
		this.saleOrderItems = saleOrderItems;
		this.quantity = quantity;
		this.price = price;
	}

	/** full constructor */
	public SaleReturnItems(SaleReturn saleReturn,
			SaleOrderItems saleOrderItems, Integer quantity, Double price,
			String reason) {
		this.saleReturn = saleReturn;
		this.saleOrderItems = saleOrderItems;
		this.quantity = quantity;
		this.price = price;
		this.reason = reason;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sale_return_id", nullable = false)
	public SaleReturn getSaleReturn() {
		return this.saleReturn;
	}

	public void setSaleReturn(SaleReturn saleReturn) {
		this.saleReturn = saleReturn;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "good_id", nullable = false)
	public SaleOrderItems getSaleOrderItems() {
		return this.saleOrderItems;
	}

	public void setSaleOrderItems(SaleOrderItems saleOrderItems) {
		this.saleOrderItems = saleOrderItems;
	}

	@Column(name = "quantity", nullable = false)
	public Integer getQuantity() {
		return this.quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	@Column(name = "price", nullable = false, precision = 40, scale = 1)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name = "reason", length = 60)
	public String getReason() {
		return this.reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

}